<?php
namespace AuctionCore\Account\Back;
use AuctionCore\System\ListBase;
use AuctionCore\CarResource\CarModel;
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                         |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: songaimin@clcw.com.cn  Blog:http://blog.csdn.net/samxx8        |
// +------------------------------------------------------------------------+
//


/**
* "员工"列表
* @author       爱民
*/
class EmployeeList extends ListBase
{

   private $base_sql = null;
   private $count_sql = null;

   public function __construct() {
      $query_sql = "SELECT * ";
       $sql = " FROM au_employee ";
      $this->base_sql = $query_sql.$sql ;
      $this->count_sql = "select count(*) count ".$sql ;
    }


    /**
    * 获取列表结果
    * @param    int $ev_page_num    每页条数
    * @param    int $page    页码
    * @return   Object
    */
    public function get($ev_page_num, $page){
        $dealer_id = $this->dealer_id;
        $Model = new \Think\Model();
       
        //拍单列表信息
        $sql = $this->base_sql;
        $sql .= " {$this->condition}";
        $skip = ($page<2?0:$ev_page_num*($page-1)) ;
        $sql .= " limit {$skip},{$ev_page_num}" ;
        $sql .= ";";
        //echo $sql;exit;
        $list = $Model->query($sql);
        return $list;
    }

    public function count(){
       $Model = new \Think\Model();
       $sql = $this->count_sql;
       $sql .= " {$this->condition}";
       $sql .= ";";
       $r = $Model->query($sql);
       return $r[0]['count'];
    }

}

?>